Apparatus and method for translating open vector graphic application program interface

ABSTRACT

Provided are an apparatus and method for OpenVG API translation, a mobile terminal comprising the translation apparatus, and a record medium storing the translation program. The apparatus comprises a data parsing unit, an OpenVG API script creating unit, and a raster image data output unit. The data parsing unit parses SVG format data depending on a data attribute. The OpenVG API script creating unit extracts an OpenVG API format syntax and creates an OpenVG API script. The raster image data output unit creates and outputs raster image data associated with the created OpenVG API script.

RELATED APPLICATIONS

This Nonprovisional application claims priority under 35 U.S.C. §119(a)to Korean Patent Application No. 10-2006-0120429 filed Dec. 1, 2006, theentire contents of which are hereby incorporated by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to open vector graphic (OpenVG)application program interface (API) translation, and more particularly,to an apparatus and method for translating OpenVG API, a mobile terminalcomprising the translation apparatus, and a record medium storing thetranslation method.

2. Description of the Related Art

Vector graphic is the digital image created by a series of commands ormathematical statements that place lines or shapes in a giventwo-dimensional or three-dimensional space. In physics, a vector is arepresentation of both a quantity and a direction at the same time. Inthe vector graphics, a graphic file that results from a graphic artist'swork is created and saved as a sequence of vector statements. Forexample, to draw a line, vector graphic file contains the information ofthe points to be connected instead of information of every point on theline. This results in much reduced file size. The vector graphic file iseasier to modify than a raster image file.

As one kind of the vector graphics, there is Scalable Vector Graphics(SVG) which describes images based on the extensible markup language(XML). SVG is widely used in the web and is abundant in contents.However, SVG is slow in speed under a mobile environment because itprocesses many driving functions by using software.

Thus, in recent years, OpenVG is being used as mobile vector graphic forcreating contents to be served for a mobile terminal. OpenVG led toimprovement on a low rate under the mobile environment because itprovides APIs which are supporting hardware acceleration to a variety ofmobile terminals. However, OpenVG results in a reduction of theefficiency of image creation thereby resulting in a shortage of contentsbecause contents developers have to create contents manually usingalgorithm.

SUMMARY OF THE INVENTION

Accordingly, the present invention is to provide an apparatus fortranslating OpenVG API, for providing abundant and diverse contents fora mobile terminal.

Also, the present invention is to provide an apparatus for translatingOpenVG API, for promoting high-rate processing of driven contents and areduction of consumption power in a mobile terminal.

Also, the present invention is to provide a method for translatingOpenVG API, for efficiently providing abundant and diverse OpenVGcontents to contents developer.

Also, the present invention is to provide a mobile terminal comprisingan apparatus for translating OpenVG API and a computer readable recordmedium storing a program which realizes a method for translating OpenVGAPI.

In one aspect, there is provided an apparatus for translating OpenVGAPI. The apparatus comprises a data parsing unit, an OpenVG API scriptcreating unit, and a raster image data output unit. The data parsingunit parses SVG format data depending on a data attribute. The OpenVGAPI script creating unit extracts an OpenVG API format syntax associatedwith each of the parsed SVG format data and creates an OpenVG APIscript. The raster image data output unit creates and outputs rasterimage data associated with the created OpenVG API script.

The parsing unit may comprise a data reading unit configured to read theSVG format data, a data parser configured to parse the read SVG formatdata depending on the data attribute, a data analyzing unit configuredto check and analyze the parsed SVG format data, and a first storageunit configured to store the analyzed SVG format data on a per-attributebasis.

The data analyzing unit may transmit a result of the checking to thedata parser and the data reading unit in sequence.

The OpenVG API script creating unit may comprise a syntax comparatorconfigured to compare the respective parsed SVG format data with datapreviously stored in a syntax lookup table, a syntax extractorconfigured to extract an OpenVG API format syntax from the syntax lookuptable depending on the comparison result, a script creator configured tocombine the extracted OpenVG API format syntax and create the OpenVG APIscript, and a second storage unit configured to rearrange and store theOpenVG API format syntax of the OpenVG API script depending on anattribute of the created raster image data.

The syntax lookup table may store the OpenVG API format syntaxassociated with each of the SVG format data.

In another aspect, there is provided a mobile terminal comprising anapparatus for translating OpenVG API.

In a further another aspect, there is provided a method for translatingOpenVG API. The method comprises: parsing SVG format data depending on adata attribute; creating an OpenVG API script by extracting an OpenVGAPI format syntax associated with each of the parsed SVG format data;and creating and outputting raster image data associated with thecreated OpenVG API script.

The parsing may comprise: reading the SVG format data; parsing the readSVG format data depending on the data attribute; checking and analyzingthe parsed SVG format data; and storing the analyzed SVG format data ona per-attribute basis.

Depending on a result of the checking, the parsing and the reading maybe repeated.

The creating of the OpenVG API script may comprise: comparing therespective parsed SVG format data with data previously stored in asyntax lookup table; extracting an OpenVG API format syntax from thesyntax lookup table depending on the comparison result; creating theOpenVG API script by combining the extracted OpenVG API format syntax;and rearranging and storing the OpenVG API format syntax of the OpenVGAPI script depending on an attribute of the created raster image data.

The syntax lookup table may store the OpenVG API format syntaxassociated with each of the SVG format data.

In a yet another aspect, there is provided a computer readable recordmedium storing a program for executing a method for translating theOpenVG API.

It is to be understood that both the foregoing general description andthe following detailed description are exemplary and explanatory and areintended to provide further explanation of the invention as claimed.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention will be described in detail with reference to thefollowing drawings in which like numerals refer to like elements.

FIG. 1 illustrates an apparatus for translating OpenVG API according toan exemplary embodiment of the present invention;

FIGS. 2 and 3 illustrate a data parsing unit according to an exemplaryembodiment of the present invention;

FIG. 4 illustrates an OpenVG API script creating unit according to anexemplary embodiment of the present invention; and

FIG. 5 is a flowchart illustrating a method for translating OpenVG APIaccording to an exemplary embodiment of the present invention.

DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS

Preferred embodiments of the present invention will be described in amore detailed manner with reference to the drawings.

FIG. 1 illustrates an apparatus for translating OpenVG API according toan exemplary embodiment of the present invention.

As shown in FIG. 1, the OpenVG API translation apparatus comprises adata parsing unit 110, an OpenVG API script creating unit 120, and araster image data output unit 130.

The data parsing unit 110 parses Scalable Vector Graphic (SVG) formatdata depending on the attribute of the data. In detail, the data parsingunit 110 reads and parses a web-based XML data file, e.g., a file with a“svg” extension, thereby preparing OpenVG API translation of data. Adetailed description of the data parsing unit 110 will be later madewith reference to FIGS. 2 and 3.

The OpenVG API script creating unit 120 extracts an OpenVG API formatsyntax associated with each of the parsed SVG format data and creates anOpenVG API script. The OpenVG API script creating unit 120 comprises asyntax lookup table to extract the OpenVG API format syntax associatedwith the parsed SVG format data in real time. A detailed description ofthe OpenVG API script creating unit 120 will be later made withreference to FIG. 4.

The raster image data output unit 130 creates and outputs raster imagedata in a unit of pixel associated with the OpenVG API script. Theoutputted raster image data is displayed on a screen of a mobileterminal.

As described above, the OpenVG API translation apparatus according to anexemplary embodiment of the present invention can automaticallytranslate the SVG format data so that it can be used in OpenVG, therebyexpressing abundant vector graphic statements of the SVG format data byOpenVG as it stands.

In an exemplary embodiment of the present invention, a mobile terminalcan comprise the OpenVG API translation apparatus, thereby expanding acontents expression region of the mobile terminal and promotinghigh-rate processing and a reduction of consumption power throughhardware acceleration of the mobile terminal. Also, contents developercan create abundant and diverse OpenVG contents because SVG format datacan be reused. The OpenVG API translation apparatus according to thepresent invention is no hindrance to any use, if hardware accelerationis needed in OpenVG API translation, as well as the mobile terminal.Contents developer mainly does the translation process using a computer.A computer without the OpenVG API translation apparatus of the presentinvention can be used to execute the translation process, as long as ithas enough processing power to run the program, i.e., software forexecuting a method for translating an OpenVG API described later withreference to FIG. 5.

FIG. 2 illustrates the data parsing unit 110 according to an exemplaryembodiment of the present invention and FIG. 3 illustrates the dataattributes parsed according to an exemplary embodiment of the presentinvention.

As shown in FIG. 2, the data parsing unit 110 according to an exemplaryembodiment of the present invention comprises a data reading unit 210, adata parser 220, a data analyzing unit 230, and a first storage unit240.

The data reading unit 210 reads SVG format data. The data reading unit210 reads a header of data inputted to the data parsing unit 110,determines whether the input data is SVG format data, and sequentiallyreads the input data up to the last field.

The data parser 220 parses the read SVG format data depending on a dataattribute predefined by the data parsing unit 110. The data attribute isdistinguished and defined depending on information type such as a basictype, a text type, an XML type, etc. of FIG. 3 that each data intends toexpress.

The data analyzing unit 230 checks and analyzes the parsed SVG formatdata. Before analyzing, the data analyzing unit 230 checks whether theparsed SVG format data is normal or abnormal. In case that it checkedthe SVG format data is abnormal, the data analyzing unit 230 informs thedata parser 220 that the SVG format data is abnormal, and the dataparser 220 again parses the SVG format data. In case that it checked theSVG format data is abnormal again from the re-parsed SVG format data,the data analyzing unit 230 informs the data reading unit 210 that theSVG format data is abnormal, and the data reading unit 210 reads SVGformat data again. Here, the checking is limited to the predeterminednumber of times, thereby preventing an infinite loop. In other words,according to an exemplary embodiment of the present invention, the dataanalyzing unit 230 transmits the data check result to the data parser220 and the data reading unit 210 sequentially when needed, therebydetecting an abnormality or normality of SVG format data beforetranslation. After that, the data analyzing unit 230 analyzes the SVGformat data for data translation.

The first storage unit 240 stores the analyzed SVG format data on aper-attribute basis. In detail, the first storage unit 240 can store theanalyzed SVG format data on a per-attribute basis in a divided storageregion for each attribute and transmit the SVG format data to the OpenVGAPI script creating unit 120 in real time, thereby improving aprocessing rate. For the improvement of processing rate, it is desirablethat the first storage unit 240 is comprised of an internal RandomAccess Memory (RAM).

FIG. 4 illustrates the OpenVG API script creating unit according to anexemplary embodiment of the present invention.

As shown in FIG. 4, the OpenVG API script creating unit 120 according toan exemplary embodiment of the present invention comprises a syntaxcomparator 410, a syntax extractor 420, a script creator 430, and asecond storage unit 440.

The syntax comparator 410 compares each data with data previously storedin the syntax lookup table. The syntax lookup table (not shown) storesan Open VG API format syntax associated with each of SVG format data.Accordingly, the syntax comparator 410 compares the SVG format datareceived from the data parsing unit 110 with SVG format data stored inthe syntax lookup table, by one-to-one matching or substitution. Bydoing so, the syntax comparator 410 can check whether there is the sameor similar SVG format data and also, detect a matched syntax. This canlead to the improvement on a rate of translation processing and theguarantee for a reliability of translation processing.

The syntax extractor 420 extracts the OpenVG API format syntaxassociated with the SVG format data from the syntax lookup tabledepending on the comparison result.

The script creator 430 combines the extracted syntax and creates theOpenVG API script. According to an exemplary embodiment of the presentinvention, the OpenVG API script is displayed on a screen via the rasterimage data output unit 130. However, the OpenVG API script can beprovided to one or more contents developers to be used for contentsdevelopment.

The second storage unit 440 rearranges and stores a syntax of the OpenVGAPI script depending on an attribute of the created raster image data.The second storage unit 440 rearranges and stores the syntax of theOpenVG API script and transmits the stored syntax to the raster imagedata output unit 130, thereby increasing the speed of creating rasterimage data in the raster image data output unit 130. It is desirablethat the syntax is tabled to be stored on a per-attribute basis.

FIG. 5 is a flowchart illustrating a method for translating the OpenVGAPI according to an exemplary embodiment of the present invention.

As shown in FIG. 5, the method for translating OpenVG API according toan exemplary embodiment of the present invention comprises parsing theSVG format data depending on a data attribute, which comprises thesubsteps 501 to 504. In detail, in the Step 501, input SVG format datais read. In the Step 502, the read SVG format data is parsed dependingon a data attribute. In the Step 503, it is checked that the parsed SVGformat data is abnormal, and the SVG format data is analyzed. In theStep 503, in case that the parsed SVG format data is determined to beabnormal at first, the Step 502 is repeated. And in case that the parsedSVG format data is determined to be abnormal again, the Step 501 and theStep 502 are repeated. Here, the repetition times is limited to a finitenumber, thereby preventing the infinite repetition. In the Step 503, incase that the parsed SVG format data is determined to be normal, thenthe parsed SVG format data is analyzed. In the Step 504, the analyzedSVG format data is stored on a per-attribute basis.

The OpenVG API translation method according to an exemplary embodimentof the present invention comprises, after the steps 501 to 504, Step ofcreating an OpenVG API script which comprises the substeps 505 to 508.In more detail, in the Step 505, each of the stored SVG format data iscompared with data previously stored in a syntax lookup table. Thesyntax lookup table stores the OpenVG API format syntax associated witheach of the SVG format data. In the Step 506, the OpenVG API formatsyntax is extracted from the syntax lookup table depending on thecomparison result. In the Step 507, the extracted OpenVG API formatsyntax is combined and an OpenVG API script is created. In the Step 508,a syntax of the OpenVG API script is rearranged and stored depending onan attribute of the created raster image data.

In Step 509, raster image data associated with the rearranged and storedscript is created and outputted. Here, a method for outputting theraster image data varies depending on an operation system for executingthe outputting method.

As described above, the OpenVG API translation method according to anexemplary embodiment of the present invention can automaticallytranslate the SVG format data so that it can be used in OpenVG, therebyexpressing abundant vector graphic statements of the SVG format data byOpenVG as it stands. Also, a contents developer can create abundant anddiverse OpenVG contents because SVG format data can be reused. Asdescribed above, the present invention has an effect of translating theSVG format data by OpenVG API, thereby providing abundant and diversecontents to a mobile terminal.

Also, the present invention has an effect of promoting high-rateprocessing of driven contents and a reduction of power consumption inthe mobile terminal.

Also, the present invention has an effect of providing abundant anddiverse OpenVG contents to a contents developer with a great efficiency.

The invention being thus described, it will be obvious that the same maybe varied in many ways. Such variations are not to be regarded as adeparture from the spirit and scope of the invention, and all suchmodifications as would be obvious to one skilled in the art are intendedto be included within the scope of the following claims.

What is claimed is:
 1. An apparatus for translating open Vector Graphic(OpenVG) Application Program Interface (API) applied to a mobileterminal, the apparatus comprising: a data parsing unit configured toparse Scalable Vector Graphic (SVG) format data depending on anattribute of the data, wherein the attribute of the data isdistinguished and defined depending on information type including abasic type, a text type and eXtensible Markup Language (XML) type; anOpenVG API script creating unit configured to create an OpenVG APIscript by extracting an OpenVG API format syntax associated with each ofthe parsed SVG format data; and a raster image data output unitconfigured to create and output a raster image data associated with thecreated OpenVG API script, wherein the OpenVG API script creating unitcomprises a second storage unit configured to rearrange and store theOpenVG API format syntax of the OpenVG API script depending on anattribute of the raster image data.
 2. The apparatus of claim 1, whereinthe parsing unit comprises: a data reading unit configured to read theSVG format data; a data parser configured to parse the read SVG formatdata depending on the attribute of the data; a data analyzing unitconfigured to check and analyze the parsed SVG format data; and a firststorage unit configured to store the analyzed SVG format data on aper-attribute basis.
 3. The apparatus of claim 2, wherein the dataanalyzing unit transmits a result of the checking to the data parser andthe data reading unit sequentially.
 4. The apparatus of claim 3,wherein, if the SVG format data is checked to be abnormal, the dataparser is configured to parse the SVG format data again, and if there-parsed SVG format data is checked to be abnormal, the data readingunit is configured to read the SVG format data again.
 5. The apparatusof claim 4, wherein the syntax lookup table stores the OpenVG API formatsyntax associated with each of the SVG format data.
 6. The apparatus ofclaim 2, wherein the data analyzing unit is configured to check the SVGformat data up to a predetermined number of times.
 7. The apparatus ofclaim 2, wherein the first storage unit is configured to store analyzedSVG format data on a per-attribute basis in a divided storage region foreach attribute, and configured to transmit the SVG format data to theOpenVG API script creating unit.
 8. The apparatus of claim 1, whereinthe OpenVG API script creating unit comprises: a syntax comparatorconfigured to compare the respective parsed SVG format data with datapreviously stored in a syntax lookup table; a syntax extractorconfigured to extract an OpenVG API format syntax from the syntax lookuptable depending on the comparison result; and a script creatorconfigured to create the OpenVG API script by combining the extractedOpenVG API format syntax.
 9. The apparatus of claim 8, wherein thesyntax comparator is configured to compare the SVG format data receivedfrom the data parsing unit with SVG format data stored in the syntaxlookup table by one-to-one matching or substitution.
 10. The apparatusof claim 8, wherein the OpenVG script is displayed on a screen via theraster image data output unit.
 11. The apparatus of claim 8, wherein theOpenVG script is provided to at least one contents developer to be usedfor contents development.
 12. A mobile terminal comprising an apparatusfor translating OpenVG API, the apparatus comprising: a data parsingunit configured to parse SVG format data depending on an attribute ofthe data, wherein the attribute of the data is distinguished and defineddepending on information type including a basic type, a text type andeXtensible Markup Language (XML) type; an OpenVG API script creatingunit configured to create an OpenVG API script by extracting an OpenVGAPI format syntax associated with each of the parsed SVG format data;and a raster image data output unit configured to create and output araster image data associated with the created OpenVG API script, whereinthe OpenVG API script creating unit comprises a second storage unitconfigured to rearrange and store the OpenVG API format syntax of theOpenVG API script depending on an attribute of the raster image data.13. A method for translating OpenVG API applied to a mobile terminal,the method comprising: parsing SVG format data depending on a dataattribute, wherein the data attribute is distinguished and defineddepending on information type including a basic type, a text type andeXtensible Markup Language (XML) type; creating an OpenVG API script byextracting an OpenVG API format syntax associated with each of theparsed SVG format data; and creating and outputting a raster image dataassociated with the created OpenVG API script, wherein the creating anOpenVG API script comprises rearranging and storing the OpenVG APIformat syntax of the OpenVG API script depending on an attribute of theraster image data.
 14. The method of claim 13, wherein the parsingcomprises: reading the SVG format data; parsing the read SVG format datadepending on the data attribute; checking and analyzing the parsed SVGformat data; and storing the analyzed SVG format data on a per-attributebasis.
 15. The method of claim 14, depending on a result of thechecking, the parsing and the reading are repeated.
 16. The method ofclaim 15, wherein the checking, parsing and reading are repeated up to apredetermined number of times.
 17. The method of claim 13, wherein thecreating an OpenVG API script comprises: comparing the respective parsedSVG format data with data previously stored in a syntax lookup table;extracting an OpenVG API format syntax from the syntax lookup tabledepending on the comparison result; and creating the OpenVG API scriptby combining the extracted OpenVG API format syntax.
 18. The method ofclaim 17, wherein the syntax lookup table stores the OpenVG API formatsyntax associated with each of the SVG format data.
 19. A non-transitorycomputer readable record medium storing a program for executing a methodfor translating an OpenVG API, the method comprising: parsing SVG formatdata depending on a data attribute, wherein the data attribute isdistinguished and defined depending on information type including abasic type, a text type and eXtensible Markup Language (XML) type;creating an OpenVG API script by extracting an OpenVG API format syntaxassociated with each of the parsed SVG format data; and creating andoutputting a raster image data associated with the created OpenVG APIscript, wherein the creating an OpenVG API script comprises rearrangingand storing the OpenVG API format syntax of the OpenVG API scriptdepending on an attribute of the raster image data.
 20. Thenon-transitory computer readable record medium of claim 19, wherein theparsing comprises: reading the SVG format data; parsing the read SVGformat data depending on the data attribute; and checking and analyzingthe parsed SVG format data.